package com.xmler.plugin.adbrocket.adb.command.receiver

import com.android.ddmlib.MultiLineReceiver

class TextLineLastReceiver: MultiLineReceiver() {
    override fun isCancelled(): Boolean = false
    private val outputLines: MutableList<String?> = ArrayList()

    val lastLineText: String?
        get() = outputLines.last()

    override fun processNewLines(lines: Array<out String>) {
        lines.forEach {
            if (it.isNotEmpty()) {
                outputLines.add(it)
            }
        }
    }
}